package org.jeecg.modules.core.passdata.controller;

import io.swagger.annotations.Api;
import io.swagger.annotations.ApiOperation;
import lombok.extern.slf4j.Slf4j;
import org.jeecg.common.api.vo.Result;
import org.jeecg.common.aspect.annotation.AutoLog;
import org.jeecg.modules.core.highway.entity.PassDataHighway;
import org.jeecg.modules.core.highway.vo.PassDataHighwayPage;
import org.jeecg.modules.core.passdata.service.HighwayCheckPointService;
import org.springframework.beans.BeanUtils;
import org.springframework.web.bind.annotation.PutMapping;
import org.springframework.web.bind.annotation.RequestBody;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

import javax.annotation.Resource;

/**
 * @Description: 公路检测点各状态更新
 * @Author: jeecg-boot
 * @Date: 2021-07-21
 * @Version: V1.0
 */
@Api(tags = "公路检测点各状态更新")
@RestController
@RequestMapping("/passData/highwayPoint")
@Slf4j
public class HighwayCheckPointController {


    @Resource
    HighwayCheckPointService highwayCheckPointService;

    /**
     * 公路检测点各状态更新
     *
     * @param
     * @return
     */
    @AutoLog(value = "公路检测点各状态更新")
    @ApiOperation(value = "公路检测点各状态更新", notes = "公路检测点各状态更新")
    @PutMapping(value = "/renewPoint")
    public Result<?> renewHighwayCheckPointState() {
        highwayCheckPointService.renewHighwayCheckPointState();
        return Result.OK("编辑成功!");
    }

    /**
     * 公路站点网络状态更新
     *
     * @param
     * @return
     */
    @AutoLog(value = "公路站点网络状态更新")
    @ApiOperation(value = "公路站点网络状态更新", notes = "公路站点网络状态更新")
    @PutMapping(value = "/renewSite")
    public Result<?> renewHighwaySiteState() {
        try {
            highwayCheckPointService.renewHighwaySiteState();
            return Result.OK("更新成功!");
        } catch (Exception e) {
            e.printStackTrace();
            return Result.OK("更新失败 !");
        }
    }
}
